|
LotusScript library: LSALibRecord
|
| Uses |
LSALibFct LSALibMsgHAddr
|
Provides higher level functions to deal with teh LiSA serialized, textual object data as described in
the LiSA-Interface reference manual
The steps to get the data are as follows
Dim DataList as Variant
Dim AttributeList List as String
Dim QueryValue as StringQuery
Serial Data = "#~#LotusP~Joe~D~Doe#LotusO~ACME"
' Create the data list of the test data with the standard function of LSALibRecord
Call CreateDataList(SerialData, DataList)
'
' get the value by logical position
QueryValue = GetValue(Query,"<LotusC>.1")
'
' create attribute mapping or get it from LiSA-Configure
AttributeList("GivenName")="<LotusC>.1"
AttributeList("FamilyName")="<LotusC>.2"
'...
' Create the mapped list with the standard function from LSALibRecord
MappingList = CreateMapping(AttributeList, DataList)
'
' get the value by logical name
QueryValue =MappingList( "GivenName")
-
Author:
-
LPS EMEA
-
Version:
-
2.0 02.NOV.2000
-
History:
-
| 02.NOV.2000 | ESc | Reworked for docu standards
|
|
Method Summary
|
Sub CreateDataList (data As String, DataList List As Node) |
Function CreateMapping (AttributeList List As String, DataList List As Node) As Variant |
Function DisplayChildren (DataList List As Node, Pos As String) As String |
Function DisplayList (DataList List As Node) As String |
Function GetDelimiterString (SerialData As String, Delimiter As String) As Integer |
Function GetPosition (Value As String, DataList List As Node) As String |
Function GetValue (Query As String, DataList List As Node) As Variant |
Function IsNonDelimiterText (TextToProof As String, Delimiter As Variant) As Integer |
Function IsSerialData (SerialData As String) As Integer |
Function SplitDelimiter (Delimiter As String) As Variant |
GetValue
Public Function GetValue(Query As String,DataList List As Node) As Variant
Given a datalist this function returns the value of the node which is specified by the
query parameter. The query specifies a position as defined by the serial data format.
If the query cannot be found an error is thrown.
Example:
Let "#~#LotusP~Joe~D~Doe#LotusO~ACME" a serial data string and datalist the corresponding
datalist.
value = GetValue("2.1", datalist) returns "Joe"
value = GetValue(".2",datalist) returns "D"
-
Parameters:
-
| Query | String | position of the node for which value the function is looking
|
| DataList | List | as Node the datalist in which the node is searched
@returns Variant the value of the specific node or an error text starting with
|
-
Errors:
-
| ErrWrongFormat | the query isn't of a proper format
|
| ErrQueryNotFound | the query couldn't be found
|
-
History:
-
| 13.JUN.2000 | RGR | Documentation created
|
GetPosition
Public Function GetPosition(Value As String,DataList List As Node) As String
Returns the position of a block descriptor on the first level. E.g.
If "#~#LotusP~Joe~D~Doe#LotusO~ACME" is a serial data string with the
corresponding datalist dList the call GetPostion("LotusP",dList) returns "2.0".
-
Parameters:
-
| Value | String | descriptor of the datablock
|
| datalist | List | as Node datalist in which the position is searched
@returns String the position of the node
|
-
History:
-
| 13.JUN.2000 | RGR | Documentation created
|
DisplayList
Public Function DisplayList(DataList List As Node) As String
Computes a string representation of a datalist. This function will not be supported in
future releases.
-
Parameters:
-
| DataList | List | as Node the list datalist which should be represented by a string
@returns String the representation
|
-
See also:
-
-
History:
-
| 13.JUN.2000 | RGR | Documentation created
|
DisplayChildren
Public Function DisplayChildren(DataList List As Node,Pos As String) As String
Helper function for function DisplayList. Creates recursively the representation
of a subtree of a datalist. This function will not be supported in future releases.
-
Parameters:
-
| DataList | List | as Node the list datalist which should be represented by a string
|
| Pos | String | the postion of the child which should be displayed
@returns String the representation
|
-
See also:
-
-
History:
-
| 13.JUN.2000 | RGR | Documentation created
|
CreateMapping
Public Function CreateMapping(AttributeList List As String,DataList List As Node) As Variant
Given an attribute list and a datalist creates a new list which uses the names of the attribute
list as keys and the corresponding node values of the data list as values.
-
Parameters:
-
| AttributeList | List | as String a list with descriptions/names as keys and postions as values
|
| DataList | List | as Node a list with positions as keys and values
@returns Variant a List as String as joined list
|
-
History:
-
| 13.JUN.2000 | RGR | Documentation created
|
CreateDataList
Public Sub CreateDataList(data As String,DataList List As Node)
Takes a serial data string, splits it into its components and builds a tree structure
which allows easy acces to the values of the serial data string. This functionj
is the heart of the library.
-
Parameters:
-
| data | String | the serial data string
|
| datalist | List | as Node the tree structure which is returned (because List cannot be returned it is neccessary
to pass in the value as paramter)
|
-
History:
-
| 13.JUN.2000 | RGR | Documentation created
|
SplitDelimiter
Public Function SplitDelimiter(Delimiter As String) As Variant
Given a string with delimiter splits it into an array. This function is
decapreared. Use VExplode of library LSALibFct.
-
Parameters:
-
| Delimiter | String | the string which should be splitted
|
-
History:
-
| 13.JUN.2000 | RGR | Documentation inserted
|
GetDelimiterString
Public Function GetDelimiterString(SerialData As String,Delimiter As String) As Integer
Given a serial data string, extracts the delimiter and returns true if the operation
was successful.
-
Parameters:
-
| SerialData | String | the serial data string
|
| Delimiter | String | the delimiters if an extraction was successful (this is a return value)
@returns boolean true, if the delimiter string could be extracted
|
-
History:
-
| 13.JUN.2000 | RGR | Documentation inserted
|
IsSerialData
Public Function IsSerialData(SerialData As String) As Integer
Checks if a string is a serial data string by checking if the rules for the delimiters are respected.
-
Parameters:
-
| SerialData | String | the string which should be scanned
@returns booolean true, if the string is a serail data string
|
-
History:
-
| 13.JUN.2000 | RGR | Documentation inserted
|
IsNonDelimiterText
Public Function IsNonDelimiterText(TextToProof As String,Delimiter As Variant) As Integer
Checks if delimiters are contained in a string. This function is used for validations.
-
Parameters:
-
| TextToProof | String | the string which should be scanned
|
| Delimiter | Variant | string or array of strings containing the delimiters
@returns boolean true, if none of the delimiters is containes in the string
|
-
History:
-
| 13.JUN.2000 | RGR | Documentation inserted
|
| Top | LotusScript Doc |
| © Lotus Professional Services |
| generated on : 05-Apr-01 10:08:21 AM |